<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Ad/adList')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="keywords" class="form-control" placeholder="请输入广告名称">
                                    </div>
                                    <button type="submit" class="btn btn-primary">查询</button>
                                    <div class="form-group pull-right">
                                        <a href="{:U('Ad/ad')}" class="btn btn-primary pull-right"><i class="fa fa-plus"></i> 新增广告</a>
                                    </div>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                        <tr role="row">
                                            <th>广告id</th>
                                            <th>广告位置id</th>
                                            <th>广告位置</th>
                                            <th>广告名称</th>
                                            <th>广告图片</th>
                                            <th>是否显示</th>
                                            <th>排序</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="list" item="vo" key="k">
                                        <tr role="row">
                                            <td style="line-height:32px;">{$vo[ad_id]}</td>
                                            <td style="line-height:32px;">{$vo[pid]}</td>
                                            <td style="line-height:32px;">{$ad_position_list[$vo[pid]][position_name]}</td>
                                            <td style="line-height:32px;">{$vo.ad_name}</td>
                                            <td>
                                             <a href="{$vo.ad_code}" target="_blank"><img alt="" src="{$vo.ad_code}" width="30px" height="30px"></a>
                                            </td>
                                            <td style="line-height:32px;">
                                                <img width="20" height="20" src="__PUBLIC__/images/<if condition='$vo[enabled] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('ad', 'ad_id', '{$vo.ad_id}', 'enabled', this)" />
                                            </td>
                                            <td style="line-height:32px;">
                                                <input type="text" onkeyup="this.value = this.value.replace(/[^\d]/g, '')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onchange="updateSort('ad', 'ad_id', '{$vo.ad_id}', 'orderby', this)" size="4" value="{$vo.orderby}" class="input-sm" />
                                            </td>
                                            <td>
                                                <a class="btn btn-primary" href="{:U('Ad/ad',array('act'=>'edit','ad_id'=>$vo['ad_id']))}"><i class="fa fa-pencil"></i></a>
                                                <a class="btn btn-danger" onclick="delfunc(this)" data-url="{:U('Ad/adHandle')}" data-id="{$vo.ad_id}"><i class="fa fa-trash-o"></i></a>
                                            </td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                    <tfoot>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <script>
    </script>
</div>
</body>

</html>
